<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>二维码生成器</title>
    <style>
      body {
        font-family: Arial, sans-serif;
        padding: 20px;
        width: 200px;
      }
      #qr-container {
        display: block;
        margin: 20px 0;
        cursor: pointer;
        text-align: center;
      }
    </style>
  </head>
  <body>
    <h3>网页二维码生成</h3>
    <div id="qr-container"></div>
    <button onclick="generateQRCode()">生成二维码</button>
    <script src="qrcode.min.js"></script>
    <script>
      function generateQRCode() {
        const qrCodeElement = document.getElementById("qr-container");
        const qrCode = new QRCode(qrCodeElement, {
          text: window.location.href,
          width: 160,
          height: 160,
          colorDark: "#000000",
          colorLight: "#ffffff",
          correctLevel: QRCode.CorrectLevel.H,
        });
      }
    </script>
  </body>
</html>
